const mongoose = require('mongoose');
const mongoosePaginate = require("mongoose-paginate");
var schema = new mongoose.Schema({
    newsId: mongoose.Schema.ObjectId,
    title: String,
    content: String,
    author: String,
    releasetime: Date,
    updatetime: Date,
    updateby: String,
    hits: Number,
    greats: Number,
    keywords: String,
    descript: String,
    transmits: Number,
    commentCount:{
        type:Number,
        default:0
    }
});
schema.plugin(mongoosePaginate);

module.exports = mongoose.model('New', schema);
//     newsId: mongoose.Schema.ObjectId
//     title：string
//     content:string
//     author:string
//     releasetime:Date(发布时间)
//     updatetime：date(修改时间)
//     updateby：string(修改人)
//     hits：number(浏览数)
//     greats：number(点赞数)
//     keywords:string
//     descript：string(描述)
//     transmits:number(转发量数)